package com.tony.aop;

import com.tony.aop.service.HelloWordService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AopApplication {
    public static void main(String[] args) {
        test2();
    }

    private static void test2() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext2.xml");
        HelloWordService hw = (HelloWordService) ac.getBean("hw");
//        hw.printHelloWorld();
//        hw.doPrint();
        hw.dealName("tony");
    }

    private static void test1() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        HelloWordService hw = (HelloWordService) ac.getBean("helloService");
//        hw.printHelloWorld();
//        hw.doPrint();
        hw.dealName("tony");
    }
}
